let container = document.querySelector(".container");
let boxes = document.querySelectorAll(".box");

let btn = document.querySelectorAll("button");



boxes.forEach((item) => {
    item.addEventListener("click", (e) => {
        e.stopPropagation();
		item.style.backgroundColor = "#fff";
		item.children[0].children[1].innerHTML = "×";
		item.children[1].style.display = "block";
	});
    item.addEventListener("blur", (e) => {
         e.stopPropagation();
		item.children[1].style.display = "none";
		item.style.backgroundColor = "#ccc";
		item.children[0].children[1].innerHTML = ">";
	});
});

btn.forEach((item) => {
	item.addEventListener("click", () => {
		if (item.innerText === "×") {
			container.removeChild(item.parentNode.parentNode);
		}
	});
});


